﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _04ThirdBit
{
    class _05ThirdBit
    {
        static void Main(string[] args)
        {
            
            Console.WriteLine("This program will find out if the third bit (starting from zero) of an integer is 1 or 0.\nEnter an ineger:");
            
            int number = int.Parse(Console.ReadLine());
            
            int mask = 8;   // in binary = 1000
            
            int maskAndNumber = mask & number;
            
            bool check = maskAndNumber == 8;
            
            Console.WriteLine(check ? "The third bit is one." : "The third bit is zero.");

        }
    }
}
